package kr.or.kead.ui.list.model;

import kr.or.kead.domain.Depart;
import kr.or.kead.service.DaoTable;
import kr.or.kead.service.Daodepart;

public class ProessorCustomTableModel extends AbsCustomTableModel {
	private DaoTable daoDepart;
	
	public ProessorCustomTableModel() {
		daoDepart = new Daodepart();
		sql = "select code '교수코드', name ' 교수명', depart '학과명', course '과목명', email 'E-MAIL' from professor";
		getResultSet();
		
	}
	@Override
	public Object getValueAt(int row, int col) {
		Object[] professor = arData.get(row);
		switch(col){
		case 0: case 1: return professor[col];
		case 2: Depart depart= (Depart) daoDepart.selectTableById((int)professor[col]);
			return depart.getName();
		case 3: case 4: return professor[col];
		
		}
		return "";
	}

}
